<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LANGUAGE Trustworthy #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE NoImplicitPrelude, MagicHash #-}</span><span>
</span><span id="line-3"></span><span class="hs-pragma">{-# LANGUAGE StandaloneDeriving #-}</span><span>
</span><span id="line-4"></span><span>
</span><span id="line-5"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Module      :  Control.Exception.Base</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2001</span><span>
</span><span id="line-9"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-10"></span><span class="hs-comment">--</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Stability   :  experimental</span><span>
</span><span id="line-13"></span><span class="hs-comment">-- Portability :  non-portable (extended exceptions)</span><span>
</span><span id="line-14"></span><span class="hs-comment">--</span><span>
</span><span id="line-15"></span><span class="hs-comment">-- Extensible exceptions, except for multiple handlers.</span><span>
</span><span id="line-16"></span><span class="hs-comment">--</span><span>
</span><span id="line-17"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">Control.Exception.Base</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span>        </span><span class="annot"><span class="hs-comment">-- * The Exception type</span></span><span>
</span><span id="line-22"></span><span>        </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier">SomeException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier">Exception</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-24"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#IOException"><span class="hs-identifier">IOException</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-25"></span><span>        </span><span class="annot"><a href="GHC.Exception.Type.html#ArithException"><span class="hs-identifier">ArithException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-26"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#ArrayException"><span class="hs-identifier">ArrayException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-27"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#AssertionFailed"><span class="hs-identifier">AssertionFailed</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#SomeAsyncException"><span class="hs-identifier">SomeAsyncException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Exception.html#AsyncException"><span class="hs-identifier">AsyncException</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-29"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#asyncExceptionToException"><span class="hs-identifier">asyncExceptionToException</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.IO.Exception.html#asyncExceptionFromException"><span class="hs-identifier">asyncExceptionFromException</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-30"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#NonTermination"><span class="hs-identifier">NonTermination</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-31"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#NestedAtomically"><span class="hs-identifier">NestedAtomically</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-32"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#BlockedIndefinitelyOnMVar"><span class="hs-identifier">BlockedIndefinitelyOnMVar</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-33"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#FixIOException"><span class="hs-identifier">FixIOException</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-34"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#BlockedIndefinitelyOnSTM"><span class="hs-identifier">BlockedIndefinitelyOnSTM</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-35"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#AllocationLimitExceeded"><span class="hs-identifier">AllocationLimitExceeded</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-36"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#CompactionFailed"><span class="hs-identifier">CompactionFailed</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-37"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#Deadlock"><span class="hs-identifier">Deadlock</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-38"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#NoMethodError"><span class="hs-identifier">NoMethodError</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-39"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#PatternMatchFail"><span class="hs-identifier">PatternMatchFail</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-40"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#RecConError"><span class="hs-identifier">RecConError</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-41"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#RecSelError"><span class="hs-identifier">RecSelError</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-42"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#RecUpdError"><span class="hs-identifier">RecUpdError</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-43"></span><span>        </span><span class="annot"><a href="GHC.Exception.html#ErrorCall"><span class="hs-identifier">ErrorCall</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-44"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#TypeError"><span class="hs-identifier">TypeError</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="hs-comment">-- #10284, custom error type for deferred type errors</span><span>
</span><span id="line-45"></span><span>
</span><span id="line-46"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Throwing exceptions</span></span><span>
</span><span id="line-47"></span><span>        </span><span class="annot"><a href="GHC.IO.html#throwIO"><span class="hs-identifier">throwIO</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-48"></span><span>        </span><span class="annot"><a href="GHC.Exception.html#throw"><span class="hs-identifier">throw</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-49"></span><span>        </span><span class="annot"><a href="GHC.IO.Exception.html#ioError"><span class="hs-identifier">ioError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-50"></span><span>        </span><span class="annot"><a href="GHC.Conc.Sync.html#throwTo"><span class="hs-identifier">throwTo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Catching Exceptions</span></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** The @catch@ functions</span></span><span>
</span><span id="line-55"></span><span>        </span><span class="annot"><a href="GHC.IO.html#catch"><span class="hs-identifier">catch</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-56"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#catchJust"><span class="hs-identifier">catchJust</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** The @handle@ functions</span></span><span>
</span><span id="line-59"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#handle"><span class="hs-identifier">handle</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-60"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#handleJust"><span class="hs-identifier">handleJust</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-61"></span><span>
</span><span id="line-62"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** The @try@ functions</span></span><span>
</span><span id="line-63"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#try"><span class="hs-identifier">try</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-64"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#tryJust"><span class="hs-identifier">tryJust</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-65"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#onException"><span class="hs-identifier">onException</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** The @evaluate@ function</span></span><span>
</span><span id="line-68"></span><span>        </span><span class="annot"><a href="GHC.IO.html#evaluate"><span class="hs-identifier">evaluate</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** The @mapException@ function</span></span><span>
</span><span id="line-71"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#mapException"><span class="hs-identifier">mapException</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-72"></span><span>
</span><span id="line-73"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Asynchronous Exceptions</span></span><span>
</span><span id="line-74"></span><span>
</span><span id="line-75"></span><span>        </span><span class="annot"><span class="hs-comment">-- ** Asynchronous exception control</span></span><span>
</span><span id="line-76"></span><span>        </span><span class="annot"><a href="GHC.IO.html#mask"><span class="hs-identifier">mask</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-77"></span><span>        </span><span class="annot"><a href="GHC.IO.html#mask_"><span class="hs-identifier">mask_</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-78"></span><span>        </span><span class="annot"><a href="GHC.IO.html#uninterruptibleMask"><span class="hs-identifier">uninterruptibleMask</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-79"></span><span>        </span><span class="annot"><a href="GHC.IO.html#uninterruptibleMask_"><span class="hs-identifier">uninterruptibleMask_</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-80"></span><span>        </span><span class="annot"><a href="GHC.IO.html#MaskingState"><span class="hs-identifier">MaskingState</span></a></span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-81"></span><span>        </span><span class="annot"><a href="GHC.IO.html#getMaskingState"><span class="hs-identifier">getMaskingState</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Assertions</span></span><span>
</span><span id="line-84"></span><span>
</span><span id="line-85"></span><span>        </span><span class="annot"><a href="GHC.Base.html#assert"><span class="hs-identifier">assert</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Utilities</span></span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#bracket"><span class="hs-identifier">bracket</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-90"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#bracket_"><span class="hs-identifier">bracket_</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-91"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#bracketOnError"><span class="hs-identifier">bracketOnError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-92"></span><span>
</span><span id="line-93"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#finally"><span class="hs-identifier">finally</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-94"></span><span>
</span><span id="line-95"></span><span>        </span><span class="annot"><span class="hs-comment">-- * Calls for GHC runtime</span></span><span>
</span><span id="line-96"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#recSelError"><span class="hs-identifier">recSelError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#recConError"><span class="hs-identifier">recConError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#runtimeError"><span class="hs-identifier">runtimeError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-97"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#nonExhaustiveGuardsError"><span class="hs-identifier">nonExhaustiveGuardsError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#patError"><span class="hs-identifier">patError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#noMethodBindingError"><span class="hs-identifier">noMethodBindingError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-98"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#absentError"><span class="hs-identifier">absentError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#typeError"><span class="hs-identifier">typeError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-99"></span><span>        </span><span class="annot"><a href="Control.Exception.Base.html#nonTermination"><span class="hs-identifier">nonTermination</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#nestedAtomically"><span class="hs-identifier">nestedAtomically</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-100"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-101"></span><span>
</span><span id="line-102"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Base.html"><span class="hs-identifier">GHC.Base</span></a></span><span>
</span><span id="line-103"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.html"><span class="hs-identifier">GHC.IO</span></a></span><span> </span><span class="hs-keyword">hiding</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.IO.html#bracket"><span class="hs-identifier">bracket</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.IO.html#finally"><span class="hs-identifier">finally</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.IO.html#onException"><span class="hs-identifier">onException</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-104"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.IO.Exception.html"><span class="hs-identifier">GHC.IO.Exception</span></a></span><span>
</span><span id="line-105"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Exception.html"><span class="hs-identifier">GHC.Exception</span></a></span><span>
</span><span id="line-106"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Show.html"><span class="hs-identifier">GHC.Show</span></a></span><span>
</span><span id="line-107"></span><span class="hs-comment">-- import GHC.Exception hiding ( Exception )</span><span>
</span><span id="line-108"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Conc.Sync.html"><span class="hs-identifier">GHC.Conc.Sync</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Either.html"><span class="hs-identifier">Data.Either</span></a></span><span>
</span><span id="line-111"></span><span>
</span><span id="line-112"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-113"></span><span class="hs-comment">-- Catching exceptions</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span class="hs-comment">-- | The function 'catchJust' is like 'catch', but it takes an extra</span><span>
</span><span id="line-116"></span><span class="hs-comment">-- argument which is an /exception predicate/, a function which</span><span>
</span><span id="line-117"></span><span class="hs-comment">-- selects which type of exceptions we\'re interested in.</span><span>
</span><span id="line-118"></span><span class="hs-comment">--</span><span>
</span><span id="line-119"></span><span class="hs-comment">-- &gt; catchJust (\e -&gt; if isDoesNotExistErrorType (ioeGetErrorType e) then Just () else Nothing)</span><span>
</span><span id="line-120"></span><span class="hs-comment">-- &gt;           (readFile f)</span><span>
</span><span id="line-121"></span><span class="hs-comment">-- &gt;           (\_ -&gt; do hPutStrLn stderr (&quot;No such file: &quot; ++ show f)</span><span>
</span><span id="line-122"></span><span class="hs-comment">-- &gt;                     return &quot;&quot;)</span><span>
</span><span id="line-123"></span><span class="hs-comment">--</span><span>
</span><span id="line-124"></span><span class="hs-comment">-- Any other exceptions which are not matched by the predicate</span><span>
</span><span id="line-125"></span><span class="hs-comment">-- are re-raised, and may be caught by an enclosing</span><span>
</span><span id="line-126"></span><span class="hs-comment">-- 'catch', 'catchJust', etc.</span><span>
</span><span id="line-127"></span><span id="local-6989586621679539314"><span id="local-6989586621679539315"><span id="local-6989586621679539316"><span class="annot"><a href="Control.Exception.Base.html#catchJust"><span class="hs-identifier hs-type">catchJust</span></a></span><span>
</span><span id="line-128"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539316"><span class="hs-identifier hs-type">e</span></a></span><span>
</span><span id="line-129"></span><span>        </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539316"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539315"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>         </span><span class="hs-comment">-- ^ Predicate to select exceptions</span><span>
</span><span id="line-130"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539314"><span class="hs-identifier hs-type">a</span></a></span><span>                   </span><span class="hs-comment">-- ^ Computation to run</span><span>
</span><span id="line-131"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539315"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539314"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span>            </span><span class="hs-comment">-- ^ Handler</span><span>
</span><span id="line-132"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539314"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-133"></span><span id="catchJust"><span class="annot"><span class="annottext">catchJust :: forall e b a.
Exception e =&gt;
(e -&gt; Maybe b) -&gt; IO a -&gt; (b -&gt; IO a) -&gt; IO a
</span><a href="Control.Exception.Base.html#catchJust"><span class="hs-identifier hs-var hs-var">catchJust</span></a></span></span><span> </span><span id="local-6989586621679539119"><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679539119"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679539118"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539118"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="local-6989586621679539117"><span class="annot"><span class="annottext">b -&gt; IO a
</span><a href="#local-6989586621679539117"><span class="hs-identifier hs-var">handler</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (e -&gt; IO a) -&gt; IO a
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="GHC.IO.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539118"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; IO a
</span><a href="#local-6989586621679539116"><span class="hs-identifier hs-var">handler'</span></a></span><span>
</span><span id="line-134"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679539116"><span class="annot"><span class="annottext">handler' :: e -&gt; IO a
</span><a href="#local-6989586621679539116"><span class="hs-identifier hs-var hs-var">handler'</span></a></span></span><span> </span><span id="local-6989586621679539114"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679539114"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679539119"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679539114"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-135"></span><span>                        </span><span class="annot"><span class="annottext">Maybe b
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">e -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679539114"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-136"></span><span>                        </span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679539113"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679539113"><span class="hs-identifier hs-var">b</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">b -&gt; IO a
</span><a href="#local-6989586621679539117"><span class="hs-identifier hs-var">handler</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679539113"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span class="hs-comment">-- | A version of 'catch' with the arguments swapped around; useful in</span><span>
</span><span id="line-139"></span><span class="hs-comment">-- situations where the code for the handler is shorter.  For example:</span><span>
</span><span id="line-140"></span><span class="hs-comment">--</span><span>
</span><span id="line-141"></span><span class="hs-comment">-- &gt;   do handle (\NonTermination -&gt; exitWith (ExitFailure 1)) $</span><span>
</span><span id="line-142"></span><span class="hs-comment">-- &gt;      ...</span><span>
</span><span id="line-143"></span><span id="local-6989586621679539305"><span id="local-6989586621679539306"><span class="annot"><a href="Control.Exception.Base.html#handle"><span class="hs-identifier hs-type">handle</span></a></span><span>     </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539306"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539306"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539305"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539305"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539305"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-144"></span><span id="handle"><span class="annot"><span class="annottext">handle :: forall e a. Exception e =&gt; (e -&gt; IO a) -&gt; IO a -&gt; IO a
</span><a href="Control.Exception.Base.html#handle"><span class="hs-identifier hs-var hs-var">handle</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">(IO a -&gt; (e -&gt; IO a) -&gt; IO a) -&gt; (e -&gt; IO a) -&gt; IO a -&gt; IO a
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (e -&gt; IO a) -&gt; IO a
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="GHC.IO.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-comment">-- | A version of 'catchJust' with the arguments swapped around (see</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- 'handle').</span><span>
</span><span id="line-148"></span><span id="local-6989586621679539297"><span id="local-6989586621679539298"><span id="local-6989586621679539299"><span class="annot"><a href="Control.Exception.Base.html#handleJust"><span class="hs-identifier hs-type">handleJust</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539299"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539299"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539298"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539298"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539297"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539297"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539297"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-149"></span><span id="handleJust"><span class="annot"><span class="annottext">handleJust :: forall e b a.
Exception e =&gt;
(e -&gt; Maybe b) -&gt; (b -&gt; IO a) -&gt; IO a -&gt; IO a
</span><a href="Control.Exception.Base.html#handleJust"><span class="hs-identifier hs-var hs-var">handleJust</span></a></span></span><span> </span><span id="local-6989586621679539107"><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679539107"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">(IO a -&gt; (b -&gt; IO a) -&gt; IO a) -&gt; (b -&gt; IO a) -&gt; IO a -&gt; IO a
forall a b c. (a -&gt; b -&gt; c) -&gt; b -&gt; a -&gt; c
</span><a href="GHC.Base.html#flip"><span class="hs-identifier hs-var">flip</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(e -&gt; Maybe b) -&gt; IO a -&gt; (b -&gt; IO a) -&gt; IO a
forall e b a.
Exception e =&gt;
(e -&gt; Maybe b) -&gt; IO a -&gt; (b -&gt; IO a) -&gt; IO a
</span><a href="Control.Exception.Base.html#catchJust"><span class="hs-identifier hs-var">catchJust</span></a></span><span> </span><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679539107"><span class="hs-identifier hs-var">p</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-150"></span><span>
</span><span id="line-151"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-152"></span><span class="hs-comment">-- 'mapException'</span><span>
</span><span id="line-153"></span><span>
</span><span id="line-154"></span><span class="hs-comment">-- | This function maps one exception into another as proposed in the</span><span>
</span><span id="line-155"></span><span class="hs-comment">-- paper \&quot;A semantics for imprecise exceptions\&quot;.</span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span class="hs-comment">-- Notice that the usage of 'unsafePerformIO' is safe here.</span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span id="local-6989586621679539291"><span id="local-6989586621679539292"><span id="local-6989586621679539293"><span class="annot"><a href="Control.Exception.Base.html#mapException"><span class="hs-identifier hs-type">mapException</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539293"><span class="hs-identifier hs-type">e1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539292"><span class="hs-identifier hs-type">e2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539293"><span class="hs-identifier hs-type">e1</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679539292"><span class="hs-identifier hs-type">e2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679539291"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679539291"><span class="hs-identifier hs-type">a</span></a></span></span></span></span><span>
</span><span id="line-160"></span><span id="mapException"><span class="annot"><span class="annottext">mapException :: forall e1 e2 a.
(Exception e1, Exception e2) =&gt;
(e1 -&gt; e2) -&gt; a -&gt; a
</span><a href="Control.Exception.Base.html#mapException"><span class="hs-identifier hs-var hs-var">mapException</span></a></span></span><span> </span><span id="local-6989586621679539102"><span class="annot"><span class="annottext">e1 -&gt; e2
</span><a href="#local-6989586621679539102"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621679539101"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539101"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; a
forall a. IO a -&gt; a
</span><a href="GHC.IO.Unsafe.html#unsafePerformIO"><span class="hs-identifier hs-var">unsafePerformIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO a -&gt; (e1 -&gt; IO a) -&gt; IO a
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="GHC.IO.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; IO a
forall a. a -&gt; IO a
</span><a href="GHC.IO.html#evaluate"><span class="hs-identifier hs-var">evaluate</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539101"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-161"></span><span>                                          </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679539099"><span class="annot"><span class="annottext">e1
</span><a href="#local-6989586621679539099"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">e2 -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e1 -&gt; e2
</span><a href="#local-6989586621679539102"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">e1
</span><a href="#local-6989586621679539099"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-162"></span><span>
</span><span id="line-163"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-164"></span><span class="hs-comment">-- 'try' and variations.</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span class="hs-comment">-- | Similar to 'catch', but returns an 'Either' result which is</span><span>
</span><span id="line-167"></span><span class="hs-comment">-- @('Right' a)@ if no exception of type @e@ was raised, or @('Left' ex)@</span><span>
</span><span id="line-168"></span><span class="hs-comment">-- if an exception of type @e@ was raised and its value is @ex@.</span><span>
</span><span id="line-169"></span><span class="hs-comment">-- If any other type of exception is raised then it will be propagated</span><span>
</span><span id="line-170"></span><span class="hs-comment">-- up to the next enclosing exception handler.</span><span>
</span><span id="line-171"></span><span class="hs-comment">--</span><span>
</span><span id="line-172"></span><span class="hs-comment">-- &gt;  try a = catch (Right `liftM` a) (return . Left)</span><span>
</span><span id="line-173"></span><span>
</span><span id="line-174"></span><span id="local-6989586621679539284"><span id="local-6989586621679539285"><span class="annot"><a href="Control.Exception.Base.html#try"><span class="hs-identifier hs-type">try</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539285"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539284"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539285"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539284"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span><span>
</span><span id="line-175"></span><span id="try"><span class="annot"><span class="annottext">try :: forall e a. Exception e =&gt; IO a -&gt; IO (Either e a)
</span><a href="Control.Exception.Base.html#try"><span class="hs-identifier hs-var hs-var">try</span></a></span></span><span> </span><span id="local-6989586621679539092"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539092"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO (Either e a) -&gt; (e -&gt; IO (Either e a)) -&gt; IO (Either e a)
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="GHC.IO.html#catch"><span class="hs-identifier hs-var">catch</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539092"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (a -&gt; IO (Either e a)) -&gt; IO (Either e a)
forall (m :: * -&gt; *) a b. Monad m =&gt; m a -&gt; (a -&gt; m b) -&gt; m b
</span><a href="GHC.Base.html#%3E%3E%3D"><span class="hs-operator hs-var">&gt;&gt;=</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679539091"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539091"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; IO (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either e a
forall a b. b -&gt; Either a b
</span><a href="Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539091"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621679539090"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679539090"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either e a -&gt; IO (Either e a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">e -&gt; Either e a
forall a b. a -&gt; Either a b
</span><a href="Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679539090"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-176"></span><span>
</span><span id="line-177"></span><span class="hs-comment">-- | A variant of 'try' that takes an exception predicate to select</span><span>
</span><span id="line-178"></span><span class="hs-comment">-- which exceptions are caught (c.f. 'catchJust').  If the exception</span><span>
</span><span id="line-179"></span><span class="hs-comment">-- does not match the predicate, it is re-thrown.</span><span>
</span><span id="line-180"></span><span id="local-6989586621679539273"><span id="local-6989586621679539274"><span id="local-6989586621679539275"><span class="annot"><a href="Control.Exception.Base.html#tryJust"><span class="hs-identifier hs-type">tryJust</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539275"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539275"><span class="hs-identifier hs-type">e</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539274"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539273"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539274"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539273"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span></span></span></span><span>
</span><span id="line-181"></span><span id="tryJust"><span class="annot"><span class="annottext">tryJust :: forall e b a.
Exception e =&gt;
(e -&gt; Maybe b) -&gt; IO a -&gt; IO (Either b a)
</span><a href="Control.Exception.Base.html#tryJust"><span class="hs-identifier hs-var hs-var">tryJust</span></a></span></span><span> </span><span id="local-6989586621679539083"><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679539083"><span class="hs-identifier hs-var">p</span></a></span></span><span> </span><span id="local-6989586621679539082"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539082"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-182"></span><span>  </span><span id="local-6989586621679539081"><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679539081"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO (Either e a)
forall e a. Exception e =&gt; IO a -&gt; IO (Either e a)
</span><a href="Control.Exception.Base.html#try"><span class="hs-identifier hs-var">try</span></a></span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539082"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-183"></span><span>  </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Either e a
</span><a href="#local-6989586621679539081"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-184"></span><span>        </span><span class="annot"><a href="Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span id="local-6989586621679539080"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539080"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either b a -&gt; IO (Either b a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; Either b a
forall a b. b -&gt; Either a b
</span><a href="Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539080"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-185"></span><span>        </span><span class="annot"><a href="Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span>  </span><span id="local-6989586621679539079"><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679539079"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">e -&gt; Maybe b
</span><a href="#local-6989586621679539083"><span class="hs-identifier hs-var">p</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679539079"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-186"></span><span>                        </span><span class="annot"><span class="annottext">Maybe b
</span><a href="GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">e -&gt; IO (Either b a)
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="annot"><span class="annottext">e
</span><a href="#local-6989586621679539079"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-187"></span><span>                        </span><span class="annot"><a href="GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621679539078"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679539078"><span class="hs-identifier hs-var">b</span></a></span></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Either b a -&gt; IO (Either b a)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">b -&gt; Either b a
forall a b. a -&gt; Either a b
</span><a href="Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621679539078"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span>
</span><span id="line-189"></span><span class="hs-comment">-- | Like 'finally', but only performs the final action if there was an</span><span>
</span><span id="line-190"></span><span class="hs-comment">-- exception raised by the computation.</span><span>
</span><span id="line-191"></span><span id="local-6989586621679539268"><span id="local-6989586621679539269"><span class="annot"><a href="Control.Exception.Base.html#onException"><span class="hs-identifier hs-type">onException</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539269"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539268"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539269"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>
</span><span id="line-192"></span><span id="onException"><span class="annot"><span class="annottext">onException :: forall a b. IO a -&gt; IO b -&gt; IO a
</span><a href="Control.Exception.Base.html#onException"><span class="hs-identifier hs-var hs-var">onException</span></a></span></span><span> </span><span id="local-6989586621679539073"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539073"><span class="hs-identifier hs-var">io</span></a></span></span><span> </span><span id="local-6989586621679539072"><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679539072"><span class="hs-identifier hs-var">what</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539073"><span class="hs-identifier hs-var">io</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (SomeException -&gt; IO a) -&gt; IO a
forall e a. Exception e =&gt; IO a -&gt; (e -&gt; IO a) -&gt; IO a
</span><a href="GHC.IO.html#catch"><span class="hs-operator hs-var">`catch`</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679539071"><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679539071"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679539072"><span class="hs-identifier hs-var">what</span></a></span><span>
</span><span id="line-193"></span><span>                                          </span><span class="annot"><span class="annottext">SomeException -&gt; IO a
forall e a. Exception e =&gt; e -&gt; IO a
</span><a href="GHC.IO.html#throwIO"><span class="hs-identifier hs-var">throwIO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SomeException
</span><a href="#local-6989586621679539071"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-196"></span><span class="hs-comment">-- Some Useful Functions</span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span class="hs-comment">-- | When you want to acquire a resource, do some work with it, and</span><span>
</span><span id="line-199"></span><span class="hs-comment">-- then release the resource, it is a good idea to use 'bracket',</span><span>
</span><span id="line-200"></span><span class="hs-comment">-- because 'bracket' will install the necessary exception handler to</span><span>
</span><span id="line-201"></span><span class="hs-comment">-- release the resource in the event that an exception is raised</span><span>
</span><span id="line-202"></span><span class="hs-comment">-- during the computation.  If an exception is raised, then 'bracket' will</span><span>
</span><span id="line-203"></span><span class="hs-comment">-- re-raise the exception (after performing the release).</span><span>
</span><span id="line-204"></span><span class="hs-comment">--</span><span>
</span><span id="line-205"></span><span class="hs-comment">-- A common example is opening a file:</span><span>
</span><span id="line-206"></span><span class="hs-comment">--</span><span>
</span><span id="line-207"></span><span class="hs-comment">-- &gt; bracket</span><span>
</span><span id="line-208"></span><span class="hs-comment">-- &gt;   (openFile &quot;filename&quot; ReadMode)</span><span>
</span><span id="line-209"></span><span class="hs-comment">-- &gt;   (hClose)</span><span>
</span><span id="line-210"></span><span class="hs-comment">-- &gt;   (\fileHandle -&gt; do { ... })</span><span>
</span><span id="line-211"></span><span class="hs-comment">--</span><span>
</span><span id="line-212"></span><span class="hs-comment">-- The arguments to 'bracket' are in this order so that we can partially apply</span><span>
</span><span id="line-213"></span><span class="hs-comment">-- it, e.g.:</span><span>
</span><span id="line-214"></span><span class="hs-comment">--</span><span>
</span><span id="line-215"></span><span class="hs-comment">-- &gt; withFile name mode = bracket (openFile name mode) hClose</span><span>
</span><span id="line-216"></span><span class="hs-comment">--</span><span>
</span><span id="line-217"></span><span id="local-6989586621679539262"><span id="local-6989586621679539263"><span id="local-6989586621679539264"><span class="annot"><a href="Control.Exception.Base.html#bracket"><span class="hs-identifier hs-type">bracket</span></a></span><span>
</span><span id="line-218"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539264"><span class="hs-identifier hs-type">a</span></a></span><span>         </span><span class="hs-comment">-- ^ computation to run first (\&quot;acquire resource\&quot;)</span><span>
</span><span id="line-219"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539264"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539263"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ computation to run last (\&quot;release resource\&quot;)</span><span>
</span><span id="line-220"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539264"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539262"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ computation to run in-between</span><span>
</span><span id="line-221"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539262"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>         </span><span class="hs-comment">-- returns the value from the in-between computation</span><span>
</span><span id="line-222"></span><span id="bracket"><span class="annot"><span class="annottext">bracket :: forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var hs-var">bracket</span></a></span></span><span> </span><span id="local-6989586621679539066"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539066"><span class="hs-identifier hs-var">before</span></a></span></span><span> </span><span id="local-6989586621679539065"><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679539065"><span class="hs-identifier hs-var">after</span></a></span></span><span> </span><span id="local-6989586621679539064"><span class="annot"><span class="annottext">a -&gt; IO c
</span><a href="#local-6989586621679539064"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-223"></span><span>  </span><span class="annot"><span class="annottext">((forall a. IO a -&gt; IO a) -&gt; IO c) -&gt; IO c
forall b. ((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
</span><a href="GHC.IO.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. IO a -&gt; IO a) -&gt; IO c) -&gt; IO c)
-&gt; ((forall a. IO a -&gt; IO a) -&gt; IO c) -&gt; IO c
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679539063"><span class="annot"><span class="annottext">forall a. IO a -&gt; IO a
</span><a href="#local-6989586621679539063"><span class="hs-identifier hs-var">restore</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-224"></span><span>    </span><span id="local-6989586621679539062"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539062"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539066"><span class="hs-identifier hs-var">before</span></a></span><span>
</span><span id="line-225"></span><span>    </span><span id="local-6989586621679539061"><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679539061"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO c -&gt; IO c
forall a. IO a -&gt; IO a
</span><a href="#local-6989586621679539063"><span class="hs-identifier hs-var">restore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; IO c
</span><a href="#local-6989586621679539064"><span class="hs-identifier hs-var">thing</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539062"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO c -&gt; IO b -&gt; IO c
forall a b. IO a -&gt; IO b -&gt; IO a
</span><a href="Control.Exception.Base.html#onException"><span class="hs-operator hs-var">`onException`</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679539065"><span class="hs-identifier hs-var">after</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539062"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-226"></span><span>    </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679539065"><span class="hs-identifier hs-var">after</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539062"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-227"></span><span>    </span><span class="annot"><span class="annottext">c -&gt; IO c
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">c
</span><a href="#local-6989586621679539061"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-228"></span><span>
</span><span id="line-229"></span><span class="hs-comment">-- | A specialised variant of 'bracket' with just a computation to run</span><span>
</span><span id="line-230"></span><span class="hs-comment">-- afterward.</span><span>
</span><span id="line-231"></span><span class="hs-comment">--</span><span>
</span><span id="line-232"></span><span id="local-6989586621679539059"><span id="local-6989586621679539060"><span class="annot"><a href="Control.Exception.Base.html#finally"><span class="hs-identifier hs-type">finally</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539060"><span class="hs-identifier hs-type">a</span></a></span><span>         </span><span class="hs-comment">-- ^ computation to run first</span><span>
</span><span id="line-233"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539059"><span class="hs-identifier hs-type">b</span></a></span><span>         </span><span class="hs-comment">-- ^ computation to run afterward (even if an exception</span><span>
</span><span id="line-234"></span><span>                        </span><span class="hs-comment">-- was raised)</span><span>
</span><span id="line-235"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539060"><span class="hs-identifier hs-type">a</span></a></span></span></span><span>         </span><span class="hs-comment">-- returns the value from the first computation</span><span>
</span><span id="line-236"></span><span id="local-6989586621679539055"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539055"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span id="finally"><span class="annot"><span class="annottext">finally :: forall a b. IO a -&gt; IO b -&gt; IO a
</span><a href="Control.Exception.Base.html#finally"><span class="hs-operator hs-var hs-var">`finally`</span></a></span></span><span> </span><span id="local-6989586621679539054"><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679539054"><span class="hs-identifier hs-var">sequel</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-237"></span><span>  </span><span class="annot"><span class="annottext">((forall a. IO a -&gt; IO a) -&gt; IO a) -&gt; IO a
forall b. ((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
</span><a href="GHC.IO.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. IO a -&gt; IO a) -&gt; IO a) -&gt; IO a)
-&gt; ((forall a. IO a -&gt; IO a) -&gt; IO a) -&gt; IO a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679539053"><span class="annot"><span class="annottext">forall a. IO a -&gt; IO a
</span><a href="#local-6989586621679539053"><span class="hs-identifier hs-var">restore</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-238"></span><span>    </span><span id="local-6989586621679539052"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539052"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO a
forall a. IO a -&gt; IO a
</span><a href="#local-6989586621679539053"><span class="hs-identifier hs-var">restore</span></a></span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539055"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">IO a -&gt; IO b -&gt; IO a
forall a b. IO a -&gt; IO b -&gt; IO a
</span><a href="Control.Exception.Base.html#onException"><span class="hs-operator hs-var">`onException`</span></a></span><span> </span><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679539054"><span class="hs-identifier hs-var">sequel</span></a></span><span>
</span><span id="line-239"></span><span>    </span><span class="annot"><span class="annottext">b
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679539054"><span class="hs-identifier hs-var">sequel</span></a></span><span>
</span><span id="line-240"></span><span>    </span><span class="annot"><span class="annottext">a -&gt; IO a
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539052"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span class="hs-comment">-- | A variant of 'bracket' where the return value from the first computation</span><span>
</span><span id="line-243"></span><span class="hs-comment">-- is not required.</span><span>
</span><span id="line-244"></span><span id="local-6989586621679539249"><span id="local-6989586621679539250"><span id="local-6989586621679539251"><span class="annot"><a href="Control.Exception.Base.html#bracket_"><span class="hs-identifier hs-type">bracket_</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539251"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539250"><span class="hs-identifier hs-type">b</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539249"><span class="hs-identifier hs-type">c</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539249"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>
</span><span id="line-245"></span><span id="bracket_"><span class="annot"><span class="annottext">bracket_ :: forall a b c. IO a -&gt; IO b -&gt; IO c -&gt; IO c
</span><a href="Control.Exception.Base.html#bracket_"><span class="hs-identifier hs-var hs-var">bracket_</span></a></span></span><span> </span><span id="local-6989586621679539051"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539051"><span class="hs-identifier hs-var">before</span></a></span></span><span> </span><span id="local-6989586621679539050"><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679539050"><span class="hs-identifier hs-var">after</span></a></span></span><span> </span><span id="local-6989586621679539049"><span class="annot"><span class="annottext">IO c
</span><a href="#local-6989586621679539049"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539051"><span class="hs-identifier hs-var">before</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO b -&gt; a -&gt; IO b
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">IO b
</span><a href="#local-6989586621679539050"><span class="hs-identifier hs-var">after</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO c -&gt; a -&gt; IO c
forall a b. a -&gt; b -&gt; a
</span><a href="GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">IO c
</span><a href="#local-6989586621679539049"><span class="hs-identifier hs-var">thing</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-246"></span><span>
</span><span id="line-247"></span><span class="hs-comment">-- | Like 'bracket', but only performs the final action if there was an</span><span>
</span><span id="line-248"></span><span class="hs-comment">-- exception raised by the in-between computation.</span><span>
</span><span id="line-249"></span><span id="local-6989586621679539045"><span id="local-6989586621679539046"><span id="local-6989586621679539047"><span class="annot"><a href="Control.Exception.Base.html#bracketOnError"><span class="hs-identifier hs-type">bracketOnError</span></a></span><span>
</span><span id="line-250"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539047"><span class="hs-identifier hs-type">a</span></a></span><span>         </span><span class="hs-comment">-- ^ computation to run first (\&quot;acquire resource\&quot;)</span><span>
</span><span id="line-251"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539047"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539046"><span class="hs-identifier hs-type">b</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ computation to run last (\&quot;release resource\&quot;)</span><span>
</span><span id="line-252"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="#local-6989586621679539047"><span class="hs-identifier hs-type">a</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539045"><span class="hs-identifier hs-type">c</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- ^ computation to run in-between</span><span>
</span><span id="line-253"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="#local-6989586621679539045"><span class="hs-identifier hs-type">c</span></a></span></span></span></span><span>         </span><span class="hs-comment">-- returns the value from the in-between computation</span><span>
</span><span id="line-254"></span><span id="bracketOnError"><span class="annot"><span class="annottext">bracketOnError :: forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="Control.Exception.Base.html#bracketOnError"><span class="hs-identifier hs-var hs-var">bracketOnError</span></a></span></span><span> </span><span id="local-6989586621679539043"><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539043"><span class="hs-identifier hs-var">before</span></a></span></span><span> </span><span id="local-6989586621679539042"><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679539042"><span class="hs-identifier hs-var">after</span></a></span></span><span> </span><span id="local-6989586621679539041"><span class="annot"><span class="annottext">a -&gt; IO c
</span><a href="#local-6989586621679539041"><span class="hs-identifier hs-var">thing</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-255"></span><span>  </span><span class="annot"><span class="annottext">((forall a. IO a -&gt; IO a) -&gt; IO c) -&gt; IO c
forall b. ((forall a. IO a -&gt; IO a) -&gt; IO b) -&gt; IO b
</span><a href="GHC.IO.html#mask"><span class="hs-identifier hs-var">mask</span></a></span><span> </span><span class="annot"><span class="annottext">(((forall a. IO a -&gt; IO a) -&gt; IO c) -&gt; IO c)
-&gt; ((forall a. IO a -&gt; IO a) -&gt; IO c) -&gt; IO c
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679539040"><span class="annot"><span class="annottext">forall a. IO a -&gt; IO a
</span><a href="#local-6989586621679539040"><span class="hs-identifier hs-var">restore</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-256"></span><span>    </span><span id="local-6989586621679539039"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539039"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a
</span><a href="#local-6989586621679539043"><span class="hs-identifier hs-var">before</span></a></span><span>
</span><span id="line-257"></span><span>    </span><span class="annot"><span class="annottext">IO c -&gt; IO c
forall a. IO a -&gt; IO a
</span><a href="#local-6989586621679539040"><span class="hs-identifier hs-var">restore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; IO c
</span><a href="#local-6989586621679539041"><span class="hs-identifier hs-var">thing</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539039"><span class="hs-identifier hs-var">a</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">IO c -&gt; IO b -&gt; IO c
forall a b. IO a -&gt; IO b -&gt; IO a
</span><a href="Control.Exception.Base.html#onException"><span class="hs-operator hs-var">`onException`</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; IO b
</span><a href="#local-6989586621679539042"><span class="hs-identifier hs-var">after</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621679539039"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="hs-comment">-----</span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span class="hs-comment">-- |A pattern match failed. The @String@ gives information about the</span><span>
</span><span id="line-262"></span><span class="hs-comment">-- source location of the pattern.</span><span>
</span><span id="line-263"></span><span class="hs-keyword">newtype</span><span> </span><span id="PatternMatchFail"><span class="annot"><a href="Control.Exception.Base.html#PatternMatchFail"><span class="hs-identifier hs-var">PatternMatchFail</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="PatternMatchFail"><span class="annot"><a href="Control.Exception.Base.html#PatternMatchFail"><span class="hs-identifier hs-var">PatternMatchFail</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-264"></span><span>
</span><span id="line-265"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-266"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679539033"><span id="local-6989586621679539035"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#PatternMatchFail"><span class="hs-identifier hs-type">PatternMatchFail</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-267"></span><span>    </span><span id="local-6989586621679539031"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; PatternMatchFail -&gt; ShowS
</span><a href="GHC.Show.html#showsPrec"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Exception.Base.html#PatternMatchFail"><span class="hs-identifier hs-type">PatternMatchFail</span></a></span><span> </span><span id="local-6989586621679539029"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679539029"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679539029"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-268"></span><span>
</span><span id="line-269"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-270"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679539018"><span id="local-6989586621679539020"><span id="local-6989586621679539022"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#PatternMatchFail"><span class="hs-identifier hs-type">PatternMatchFail</span></a></span></span></span></span><span>
</span><span id="line-271"></span><span>
</span><span id="line-272"></span><span class="hs-comment">-----</span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span class="hs-comment">-- |A record selector was applied to a constructor without the</span><span>
</span><span id="line-275"></span><span class="hs-comment">-- appropriate field. This can only happen with a datatype with</span><span>
</span><span id="line-276"></span><span class="hs-comment">-- multiple constructors, where some fields are in one constructor</span><span>
</span><span id="line-277"></span><span class="hs-comment">-- but not another. The @String@ gives information about the source</span><span>
</span><span id="line-278"></span><span class="hs-comment">-- location of the record selector.</span><span>
</span><span id="line-279"></span><span class="hs-keyword">newtype</span><span> </span><span id="RecSelError"><span class="annot"><a href="Control.Exception.Base.html#RecSelError"><span class="hs-identifier hs-var">RecSelError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="RecSelError"><span class="annot"><a href="Control.Exception.Base.html#RecSelError"><span class="hs-identifier hs-var">RecSelError</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-280"></span><span>
</span><span id="line-281"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-282"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679539011"><span id="local-6989586621679539013"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#RecSelError"><span class="hs-identifier hs-type">RecSelError</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-283"></span><span>    </span><span id="local-6989586621679539010"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; RecSelError -&gt; ShowS
</span><a href="#local-6989586621679539010"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Exception.Base.html#RecSelError"><span class="hs-identifier hs-type">RecSelError</span></a></span><span> </span><span id="local-6989586621679539009"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679539009"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679539009"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-284"></span><span>
</span><span id="line-285"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-286"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538999"><span id="local-6989586621679539001"><span id="local-6989586621679539003"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#RecSelError"><span class="hs-identifier hs-type">RecSelError</span></a></span></span></span></span><span>
</span><span id="line-287"></span><span>
</span><span id="line-288"></span><span class="hs-comment">-----</span><span>
</span><span id="line-289"></span><span>
</span><span id="line-290"></span><span class="hs-comment">-- |An uninitialised record field was used. The @String@ gives</span><span>
</span><span id="line-291"></span><span class="hs-comment">-- information about the source location where the record was</span><span>
</span><span id="line-292"></span><span class="hs-comment">-- constructed.</span><span>
</span><span id="line-293"></span><span class="hs-keyword">newtype</span><span> </span><span id="RecConError"><span class="annot"><a href="Control.Exception.Base.html#RecConError"><span class="hs-identifier hs-var">RecConError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="RecConError"><span class="annot"><a href="Control.Exception.Base.html#RecConError"><span class="hs-identifier hs-var">RecConError</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-294"></span><span>
</span><span id="line-295"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-296"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538993"><span id="local-6989586621679538995"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#RecConError"><span class="hs-identifier hs-type">RecConError</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-297"></span><span>    </span><span id="local-6989586621679538992"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; RecConError -&gt; ShowS
</span><a href="#local-6989586621679538992"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Exception.Base.html#RecConError"><span class="hs-identifier hs-type">RecConError</span></a></span><span> </span><span id="local-6989586621679538991"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679538991"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679538991"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-300"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538981"><span id="local-6989586621679538983"><span id="local-6989586621679538985"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#RecConError"><span class="hs-identifier hs-type">RecConError</span></a></span></span></span></span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span class="hs-comment">-----</span><span>
</span><span id="line-303"></span><span>
</span><span id="line-304"></span><span class="hs-comment">-- |A record update was performed on a constructor without the</span><span>
</span><span id="line-305"></span><span class="hs-comment">-- appropriate field. This can only happen with a datatype with</span><span>
</span><span id="line-306"></span><span class="hs-comment">-- multiple constructors, where some fields are in one constructor</span><span>
</span><span id="line-307"></span><span class="hs-comment">-- but not another. The @String@ gives information about the source</span><span>
</span><span id="line-308"></span><span class="hs-comment">-- location of the record update.</span><span>
</span><span id="line-309"></span><span class="hs-keyword">newtype</span><span> </span><span id="RecUpdError"><span class="annot"><a href="Control.Exception.Base.html#RecUpdError"><span class="hs-identifier hs-var">RecUpdError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="RecUpdError"><span class="annot"><a href="Control.Exception.Base.html#RecUpdError"><span class="hs-identifier hs-var">RecUpdError</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-312"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538975"><span id="local-6989586621679538977"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#RecUpdError"><span class="hs-identifier hs-type">RecUpdError</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-313"></span><span>    </span><span id="local-6989586621679538974"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; RecUpdError -&gt; ShowS
</span><a href="#local-6989586621679538974"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Exception.Base.html#RecUpdError"><span class="hs-identifier hs-type">RecUpdError</span></a></span><span> </span><span id="local-6989586621679538973"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679538973"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679538973"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-314"></span><span>
</span><span id="line-315"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-316"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538963"><span id="local-6989586621679538965"><span id="local-6989586621679538967"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#RecUpdError"><span class="hs-identifier hs-type">RecUpdError</span></a></span></span></span></span><span>
</span><span id="line-317"></span><span>
</span><span id="line-318"></span><span class="hs-comment">-----</span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span class="hs-comment">-- |A class method without a definition (neither a default definition,</span><span>
</span><span id="line-321"></span><span class="hs-comment">-- nor a definition in the appropriate instance) was called. The</span><span>
</span><span id="line-322"></span><span class="hs-comment">-- @String@ gives information about which method it was.</span><span>
</span><span id="line-323"></span><span class="hs-keyword">newtype</span><span> </span><span id="NoMethodError"><span class="annot"><a href="Control.Exception.Base.html#NoMethodError"><span class="hs-identifier hs-var">NoMethodError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="NoMethodError"><span class="annot"><a href="Control.Exception.Base.html#NoMethodError"><span class="hs-identifier hs-var">NoMethodError</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-326"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538957"><span id="local-6989586621679538959"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#NoMethodError"><span class="hs-identifier hs-type">NoMethodError</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-327"></span><span>    </span><span id="local-6989586621679538956"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; NoMethodError -&gt; ShowS
</span><a href="#local-6989586621679538956"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Exception.Base.html#NoMethodError"><span class="hs-identifier hs-type">NoMethodError</span></a></span><span> </span><span id="local-6989586621679538955"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679538955"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679538955"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-328"></span><span>
</span><span id="line-329"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-330"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538945"><span id="local-6989586621679538947"><span id="local-6989586621679538949"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#NoMethodError"><span class="hs-identifier hs-type">NoMethodError</span></a></span></span></span></span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span class="hs-comment">-----</span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span class="hs-comment">-- |An expression that didn't typecheck during compile time was called.</span><span>
</span><span id="line-335"></span><span class="hs-comment">-- This is only possible with -fdefer-type-errors. The @String@ gives</span><span>
</span><span id="line-336"></span><span class="hs-comment">-- details about the failed type check.</span><span>
</span><span id="line-337"></span><span class="hs-comment">--</span><span>
</span><span id="line-338"></span><span class="hs-comment">-- @since 4.9.0.0</span><span>
</span><span id="line-339"></span><span class="hs-keyword">newtype</span><span> </span><span id="TypeError"><span class="annot"><a href="Control.Exception.Base.html#TypeError"><span class="hs-identifier hs-var">TypeError</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="TypeError"><span class="annot"><a href="Control.Exception.Base.html#TypeError"><span class="hs-identifier hs-var">TypeError</span></a></span></span><span> </span><span class="annot"><a href="GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-342"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538939"><span id="local-6989586621679538941"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#TypeError"><span class="hs-identifier hs-type">TypeError</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-343"></span><span>    </span><span id="local-6989586621679538938"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; TypeError -&gt; ShowS
</span><a href="#local-6989586621679538938"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Control.Exception.Base.html#TypeError"><span class="hs-identifier hs-type">TypeError</span></a></span><span> </span><span id="local-6989586621679538937"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679538937"><span class="hs-identifier hs-var">err</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621679538937"><span class="hs-identifier hs-var">err</span></a></span><span>
</span><span id="line-344"></span><span>
</span><span id="line-345"></span><span class="hs-comment">-- | @since 4.9.0.0</span><span>
</span><span id="line-346"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538927"><span id="local-6989586621679538929"><span id="local-6989586621679538931"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#TypeError"><span class="hs-identifier hs-type">TypeError</span></a></span></span></span></span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span class="hs-comment">-----</span><span>
</span><span id="line-349"></span><span>
</span><span id="line-350"></span><span class="hs-comment">-- |Thrown when the runtime system detects that the computation is</span><span>
</span><span id="line-351"></span><span class="hs-comment">-- guaranteed not to terminate. Note that there is no guarantee that</span><span>
</span><span id="line-352"></span><span class="hs-comment">-- the runtime system will notice whether any given computation is</span><span>
</span><span id="line-353"></span><span class="hs-comment">-- guaranteed to terminate or not.</span><span>
</span><span id="line-354"></span><span class="hs-keyword">data</span><span> </span><span id="NonTermination"><span class="annot"><a href="Control.Exception.Base.html#NonTermination"><span class="hs-identifier hs-var">NonTermination</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="NonTermination"><span class="annot"><a href="Control.Exception.Base.html#NonTermination"><span class="hs-identifier hs-var">NonTermination</span></a></span></span><span>
</span><span id="line-355"></span><span>
</span><span id="line-356"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-357"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538921"><span id="local-6989586621679538923"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#NonTermination"><span class="hs-identifier hs-type">NonTermination</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-358"></span><span>    </span><span id="local-6989586621679538920"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; NonTermination -&gt; ShowS
</span><a href="#local-6989586621679538920"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">NonTermination
</span><a href="Control.Exception.Base.html#NonTermination"><span class="hs-identifier hs-var">NonTermination</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;&lt;&lt;loop&gt;&gt;&quot;</span></span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-361"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538910"><span id="local-6989586621679538912"><span id="local-6989586621679538914"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#NonTermination"><span class="hs-identifier hs-type">NonTermination</span></a></span></span></span></span><span>
</span><span id="line-362"></span><span>
</span><span id="line-363"></span><span class="hs-comment">-----</span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span class="hs-comment">-- |Thrown when the program attempts to call @atomically@, from the @stm@</span><span>
</span><span id="line-366"></span><span class="hs-comment">-- package, inside another call to @atomically@.</span><span>
</span><span id="line-367"></span><span class="hs-keyword">data</span><span> </span><span id="NestedAtomically"><span class="annot"><a href="Control.Exception.Base.html#NestedAtomically"><span class="hs-identifier hs-var">NestedAtomically</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="NestedAtomically"><span class="annot"><a href="Control.Exception.Base.html#NestedAtomically"><span class="hs-identifier hs-var">NestedAtomically</span></a></span></span><span>
</span><span id="line-368"></span><span>
</span><span id="line-369"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-370"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538904"><span id="local-6989586621679538906"><span class="annot"><a href="GHC.Show.html#Show"><span class="hs-identifier hs-type">Show</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#NestedAtomically"><span class="hs-identifier hs-type">NestedAtomically</span></a></span></span></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-371"></span><span>    </span><span id="local-6989586621679538903"><span class="annot"><span class="annottext">showsPrec :: Int -&gt; NestedAtomically -&gt; ShowS
</span><a href="#local-6989586621679538903"><span class="hs-identifier hs-var hs-var hs-var hs-var">showsPrec</span></a></span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">NestedAtomically
</span><a href="Control.Exception.Base.html#NestedAtomically"><span class="hs-identifier hs-var">NestedAtomically</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
</span><a href="GHC.Show.html#showString"><span class="hs-identifier hs-var">showString</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Control.Concurrent.STM.atomically was nested&quot;</span></span><span>
</span><span id="line-372"></span><span>
</span><span id="line-373"></span><span class="hs-comment">-- | @since 4.0</span><span>
</span><span id="line-374"></span><span class="hs-keyword">instance</span><span> </span><span id="local-6989586621679538893"><span id="local-6989586621679538895"><span id="local-6989586621679538897"><span class="annot"><a href="GHC.Exception.Type.html#Exception"><span class="hs-identifier hs-type">Exception</span></a></span><span> </span><span class="annot"><a href="Control.Exception.Base.html#NestedAtomically"><span class="hs-identifier hs-type">NestedAtomically</span></a></span></span></span></span><span>
</span><span id="line-375"></span><span>
</span><span id="line-376"></span><span class="hs-comment">-----</span><span>
</span><span id="line-377"></span><span>
</span><span id="line-378"></span><span id="local-6989586621679539237"><span class="annot"><a href="Control.Exception.Base.html#recSelError"><span class="hs-identifier hs-type">recSelError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#recConError"><span class="hs-identifier hs-type">recConError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#runtimeError"><span class="hs-identifier hs-type">runtimeError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-379"></span><span>  </span><span class="annot"><a href="Control.Exception.Base.html#nonExhaustiveGuardsError"><span class="hs-identifier hs-type">nonExhaustiveGuardsError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#patError"><span class="hs-identifier hs-type">patError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#noMethodBindingError"><span class="hs-identifier hs-type">noMethodBindingError</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-380"></span><span>  </span><span class="annot"><a href="Control.Exception.Base.html#absentError"><span class="hs-identifier hs-type">absentError</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="Control.Exception.Base.html#typeError"><span class="hs-identifier hs-type">typeError</span></a></span><span>
</span><span id="line-381"></span><span>        </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Prim.html#Addr%23"><span class="hs-identifier hs-type">Addr#</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621679539237"><span class="hs-identifier hs-type">a</span></a></span></span><span>   </span><span class="hs-comment">-- All take a UTF8-encoded C string</span><span>
</span><span id="line-382"></span><span>
</span><span id="line-383"></span><span id="recSelError"><span class="annot"><span class="annottext">recSelError :: forall a. Addr# -&gt; a
</span><a href="Control.Exception.Base.html#recSelError"><span class="hs-identifier hs-var hs-var">recSelError</span></a></span></span><span>              </span><span id="local-6989586621679538891"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538891"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RecSelError -&gt; a
forall a e. Exception e =&gt; e -&gt; a
</span><a href="GHC.Exception.html#throw"><span class="hs-identifier hs-var">throw</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; RecSelError
</span><a href="Control.Exception.Base.html#RecSelError"><span class="hs-identifier hs-var">RecSelError</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;No match in record selector &quot;</span></span><span>
</span><span id="line-384"></span><span>                                                 </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; String
</span><a href="../../ghc-prim/src/GHC.CString.html#unpackCStringUtf8%23"><span class="hs-identifier hs-var">unpackCStringUtf8#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538891"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- No location info unfortunately</span><span>
</span><span id="line-385"></span><span id="runtimeError"><span class="annot"><span class="annottext">runtimeError :: forall a. Addr# -&gt; a
</span><a href="Control.Exception.Base.html#runtimeError"><span class="hs-identifier hs-var hs-var">runtimeError</span></a></span></span><span>             </span><span id="local-6989586621679538890"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538890"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. String -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; String
</span><a href="../../ghc-prim/src/GHC.CString.html#unpackCStringUtf8%23"><span class="hs-identifier hs-var">unpackCStringUtf8#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538890"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>                   </span><span class="hs-comment">-- No location info unfortunately</span><span>
</span><span id="line-386"></span><span id="absentError"><span class="annot"><span class="annottext">absentError :: forall a. Addr# -&gt; a
</span><a href="Control.Exception.Base.html#absentError"><span class="hs-identifier hs-var hs-var">absentError</span></a></span></span><span>              </span><span id="local-6989586621679538888"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538888"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; a
forall a. String -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Oops!  Entered absent arg &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; ShowS
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">Addr# -&gt; String
</span><a href="../../ghc-prim/src/GHC.CString.html#unpackCStringUtf8%23"><span class="hs-identifier hs-var">unpackCStringUtf8#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538888"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-387"></span><span>
</span><span id="line-388"></span><span id="nonExhaustiveGuardsError"><span class="annot"><span class="annottext">nonExhaustiveGuardsError :: forall a. Addr# -&gt; a
</span><a href="Control.Exception.Base.html#nonExhaustiveGuardsError"><span class="hs-identifier hs-var hs-var">nonExhaustiveGuardsError</span></a></span></span><span> </span><span id="local-6989586621679538886"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538886"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatternMatchFail -&gt; a
forall a e. Exception e =&gt; e -&gt; a
</span><a href="GHC.Exception.html#throw"><span class="hs-identifier hs-var">throw</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PatternMatchFail
</span><a href="Control.Exception.Base.html#PatternMatchFail"><span class="hs-identifier hs-var">PatternMatchFail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; ShowS
</span><a href="GHC.IO.Exception.html#untangle"><span class="hs-identifier hs-var">untangle</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538886"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Non-exhaustive guards in&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span id="recConError"><span class="annot"><span class="annottext">recConError :: forall a. Addr# -&gt; a
</span><a href="Control.Exception.Base.html#recConError"><span class="hs-identifier hs-var hs-var">recConError</span></a></span></span><span>              </span><span id="local-6989586621679538883"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538883"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RecConError -&gt; a
forall a e. Exception e =&gt; e -&gt; a
</span><a href="GHC.Exception.html#throw"><span class="hs-identifier hs-var">throw</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; RecConError
</span><a href="Control.Exception.Base.html#RecConError"><span class="hs-identifier hs-var">RecConError</span></a></span><span>      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; ShowS
</span><a href="GHC.IO.Exception.html#untangle"><span class="hs-identifier hs-var">untangle</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538883"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Missing field in record construction&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-390"></span><span id="noMethodBindingError"><span class="annot"><span class="annottext">noMethodBindingError :: forall a. Addr# -&gt; a
</span><a href="Control.Exception.Base.html#noMethodBindingError"><span class="hs-identifier hs-var hs-var">noMethodBindingError</span></a></span></span><span>     </span><span id="local-6989586621679538881"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538881"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoMethodError -&gt; a
forall a e. Exception e =&gt; e -&gt; a
</span><a href="GHC.Exception.html#throw"><span class="hs-identifier hs-var">throw</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; NoMethodError
</span><a href="Control.Exception.Base.html#NoMethodError"><span class="hs-identifier hs-var">NoMethodError</span></a></span><span>    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; ShowS
</span><a href="GHC.IO.Exception.html#untangle"><span class="hs-identifier hs-var">untangle</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538881"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;No instance nor default method for class operation&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-391"></span><span id="patError"><span class="annot"><span class="annottext">patError :: forall a. Addr# -&gt; a
</span><a href="Control.Exception.Base.html#patError"><span class="hs-identifier hs-var hs-var">patError</span></a></span></span><span>                 </span><span id="local-6989586621679538879"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538879"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">PatternMatchFail -&gt; a
forall a e. Exception e =&gt; e -&gt; a
</span><a href="GHC.Exception.html#throw"><span class="hs-identifier hs-var">throw</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; PatternMatchFail
</span><a href="Control.Exception.Base.html#PatternMatchFail"><span class="hs-identifier hs-var">PatternMatchFail</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; ShowS
</span><a href="GHC.IO.Exception.html#untangle"><span class="hs-identifier hs-var">untangle</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538879"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Non-exhaustive patterns in&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-392"></span><span id="typeError"><span class="annot"><span class="annottext">typeError :: forall a. Addr# -&gt; a
</span><a href="Control.Exception.Base.html#typeError"><span class="hs-identifier hs-var hs-var">typeError</span></a></span></span><span>                </span><span id="local-6989586621679538877"><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538877"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TypeError -&gt; a
forall a e. Exception e =&gt; e -&gt; a
</span><a href="GHC.Exception.html#throw"><span class="hs-identifier hs-var">throw</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; TypeError
</span><a href="Control.Exception.Base.html#TypeError"><span class="hs-identifier hs-var">TypeError</span></a></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Addr# -&gt; String
</span><a href="../../ghc-prim/src/GHC.CString.html#unpackCStringUtf8%23"><span class="hs-identifier hs-var">unpackCStringUtf8#</span></a></span><span> </span><span class="annot"><span class="annottext">Addr#
</span><a href="#local-6989586621679538877"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-393"></span><span>
</span><span id="line-394"></span><span class="hs-comment">-- GHC's RTS calls this</span><span>
</span><span id="line-395"></span><span class="annot"><a href="Control.Exception.Base.html#nonTermination"><span class="hs-identifier hs-type">nonTermination</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span>
</span><span id="line-396"></span><span id="nonTermination"><span class="annot"><span class="annottext">nonTermination :: SomeException
</span><a href="Control.Exception.Base.html#nonTermination"><span class="hs-identifier hs-var hs-var">nonTermination</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NonTermination -&gt; SomeException
forall e. Exception e =&gt; e -&gt; SomeException
</span><a href="GHC.Exception.Type.html#toException"><span class="hs-identifier hs-var">toException</span></a></span><span> </span><span class="annot"><span class="annottext">NonTermination
</span><a href="Control.Exception.Base.html#NonTermination"><span class="hs-identifier hs-var">NonTermination</span></a></span><span>
</span><span id="line-397"></span><span>
</span><span id="line-398"></span><span class="hs-comment">-- GHC's RTS calls this</span><span>
</span><span id="line-399"></span><span class="annot"><a href="Control.Exception.Base.html#nestedAtomically"><span class="hs-identifier hs-type">nestedAtomically</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Exception.Type.html#SomeException"><span class="hs-identifier hs-type">SomeException</span></a></span><span>
</span><span id="line-400"></span><span id="nestedAtomically"><span class="annot"><span class="annottext">nestedAtomically :: SomeException
</span><a href="Control.Exception.Base.html#nestedAtomically"><span class="hs-identifier hs-var hs-var">nestedAtomically</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NestedAtomically -&gt; SomeException
forall e. Exception e =&gt; e -&gt; SomeException
</span><a href="GHC.Exception.Type.html#toException"><span class="hs-identifier hs-var">toException</span></a></span><span> </span><span class="annot"><span class="annottext">NestedAtomically
</span><a href="Control.Exception.Base.html#NestedAtomically"><span class="hs-identifier hs-var">NestedAtomically</span></a></span><span>
</span><span id="line-401"></span></pre></body></html>